{{#extend "header"}}
<title>优惠券</title>
<meta name="keywords" content="">
<meta name="description" content="">
{{/extend}}
{{#extend "style"}}
<style>
  .ui-coupon-status li{
    color: #333;
    font-size: 0.52rem;
    text-align: center;
    line-height: 1.8rem;
    height: 1.8rem;
    width: 50%;
    float: left;
    background-color: white;
  }
  .ui-coupon-status li.active{
    color: #e63c3c;
    font-size: 0.6rem;
    font-weight: bolder;
  }
  .ui-coupon-list > li{
    margin: 0.2rem 0.6rem;
    background: url(/images/coupon_bc.png) no-repeat;
    background-size: 100% 100%;
    height: 4.8rem;
    overflow: hidden;
    box-shadow: 0px 1px 10px 0 rgba(0, 0, 0, 0.1);
  }
  .ui-coupon-list > li:first-child{
    margin-top: 0.4rem;
  }
  .ui-coupon-list > li > ul{
    padding: 0 0.6rem 0 1rem;
    height: 100%;
  }
  .ui-coupon-list > li > ul >li:first-child{
    height: 3.2rem;
    position: relative;
  }
  .ui-coupon-list > li > ul >li:first-child > span{
    position: absolute;
  }
  .ui-coupon-list > li > ul >li:first-child > span:first-child{
    color: #333;
    font-size: 0.72rem;
    font-weight: bolder;
    top: 0.76rem;
  }
  .ui-coupon-list > li > ul >li:first-child > span:nth-child(2){
    color: #666;
    font-size: 0.48rem;
    top: 2rem;
  }
  .ui-coupon-list > li > ul >li:first-child > span:nth-child(3){
    color: #e63c3c;
    font-size: 1.08rem;
    top: 0.4rem;
    right: 0rem;
  }
  .ui-coupon-list > li > ul >li:first-child > span:nth-child(3) > i{
    font-size: 0.64rem;
  }
  .ui-coupon-list > li > ul >li:first-child > span:nth-child(4){
    color: #666;
    font-size: 0.48rem;
    top: 2rem;
    right: 0rem;
  }
  .ui-coupon-list > li > ul >li:last-child{
    height: 1.6rem;
    line-height: 1.6rem;
    color: #999;
    font-size: 0.48rem;
  }
  
  .ui-coupon-list > li.ui-cant-use > ul >li:first-child > span{
    color: #999;
  }
  .ui-coupon-list > li.ui-cant-use.ui-timeout > ul{
    background: url(/images/guoqi.png) no-repeat;
    background-size: 2.62rem;
    background-position: 7.40rem 1.6rem;
  }
  .ui-coupon-list > li.ui-cant-use.ui-used > ul{
    background: url(/images/shiyong.png) no-repeat;
    background-size: 2.62rem;
    background-position: 7.40rem 1.6rem;
  }
</style>
{{/extend}}
{{>nav title="优惠券" class="ui-shadow"}}
<ul class="ui-coupon-status">
  <li class="active">可使用</li>
  <li>不可用</li>
  <i class="clearfix"></i>
</ul>
<ul class="ui-coupon-list">
  <li>
    <ul>
      <li>
        <span>代金券</span>
        <span>有效期至2017-10-23</span>
        <span>90<i>元</i></span>
        <span>满199可用</span>
      </li>
      <li>仅限18630006666使用</li>
    </ul>
  </li>
  <li class="ui-cant-use ui-used">
    <ul>
      <li>
        <span>代金券</span>
        <span>有效期至2017-10-23</span>
        <span>90<i>元</i></span>
        <span>满199可用</span>
      </li>
      <li>仅限18630006666使用</li>
    </ul>
  </li>
  <li class="ui-cant-use ui-timeout">
    <ul>
      <li>
        <span>代金券</span>
        <span>有效期至2017-10-23</span>
        <span>90<i>元</i></span>
        <span>满199可用</span>
      </li>
      <li>仅限18630006666使用</li>
    </ul>
  </li>
</ul>
<div>
  
</div>  
{{#extend "script"}}
  <script>
    require.config({baseUrl: '/js/lib'});
    require(['zepto', 'lib'], function ($, lib) {
      lib = new lib();
      var fn = {
        oId: lib.getUrlParam('oId'),
        status: 0,
        init: function(){
          if(this.oId){
            $('.ui-coupon-status').remove();
          }
          this.bindEvent();
        },
        bindEvent: function(){
          var _t = this;
          $(document).on('tap', '.ui-coupon-status > li:not(.active)', function(){
            $(this).addClass('active');
            $(this).siblings().removeClass('active');
            _t.status = $(this).index()
          })
        },
      };
      fn.init();
    });
  </script>
{{/extend}}